<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
<!--    <script src="https://unpkg.com/vue@next"></script>-->
    <script src="../js/vue3.js"></script>
</head>
<body>
<div id="root"></div>
<script>
    Vue.createApp({
        data(){
            return{
                message:"hello",
                inputValue:'',
                conttext:[]
            }
        },
        methods:{
            addItem(){
                var da =this.$data.inputValue ;
               this.$data.conttext.push(da);
               this.inputValue="";
            }

        },
        mounted(){
            console.log("mounted...")
        },
        template:`
            <div>
            <input v-model="inputValue" />
            <button v-on:click="addItem"> 添加</button>
            <ul>
            <li v-for=" (item,index) of conttext ">
           {{index}}- {{ item }} -{{message}}
             </li>
              </ul>
            </div>
        `
    }).mount("#root");
</script>
</body>
</html>